import { defineStore } from 'pinia'
import { ref } from 'vue'

export const Tokens = defineStore('state', () => {
    const token: any = ref("")

    function getToken(): string {
        // console.log(token.value)
        return token.value
    }

    function setToken(data: string) {
        // console.log(data)
        token.value = data
    }

    function removeToken() {
        token.value = ""
        return token.value
    }
    const content: any = ref([])
    return { token, setToken, getToken, removeToken, content, }
}, {
    persist: true  //可以自定义配置存储的地方，这是默认储存
})
